#include <iostream>
bool isPalindrome(const std::string& s)
{
    std::string temp=s;
    int i=0,j=0;
    while(s[i]!=0)
    {
        if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')||(s[i]>='0'&&s[i]<='9'))
        {
            if(s[i]>='A'&&s[i]<='Z')
            {
                temp[j]=s[i]-('A'-'a');
            }
            else 
            {
                temp[j]=s[i];
            }
            j++;
        }
        i++;
    }
    for(int x=0;x<j;x++)
    { 
        if(temp[(j-1)-x]!=temp[x])
        {
            return false;
        }
        std::cout<<temp[(j-1)-x]<<"-"<<temp[x]<<std::endl;
    }
    return true;
}

int main()
{
    std::string str="A man, a plan, a canal: Panama";
    if(isPalindrome(str)==true)
    {
        std::cout<<"是回文"<<std::endl;
    }
    else 
    {
        std::cout<<"不是回文"<<std::endl;
    }
    
    return 0;
}